package cn.zjj.controller;

import cn.zjj.domain.Store;
import cn.zjj.service.IStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

@RestController
@RequestMapping("/store")
public class StoreController {
    @Autowired
    private IStoreService storeService;

    @PostMapping("/add")
    Map<String,Object> add(@RequestBody Store store){
        return storeService.add(store);
    };

    @PutMapping("/update")
    Map<String,Object> update(@RequestBody Store store){
        return storeService.update(store);
    };

    @GetMapping("/selectById/{product_id}")
    Store selectById(@PathVariable("product_id") Long product_id){
        return storeService.selectById(product_id);
    };
}
